package com.my.zl.console.common.constant;

import com.my.zl.common.enums.resp.RespEnum;

/**
 * 应答码，为了多模块更好管理和定义各自应答码,不使用单纯的数字，
 * 命名规则：模块名_XXXXXX
 * @author zhouliang
 *
 */
public enum AutocodeRespE implements RespEnum{
    /** */
    SUCCESS("AUTOCODE_", "Success"),
    
    DELETE_NOT_ALLOWED("DELETE_NOT_ALLOWED", "Deleting are not allowed"),
    ;
    private String code;
    private String msg;

    AutocodeRespE(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public String getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }
    
    public static String msg(String code) {
        for (AutocodeRespE m : AutocodeRespE.values()) {
            if (m.getCode() == code) {
                return m.getMsg();
            }
        }
        return null;
    }
}